import { sendCommandMini } from '@/api/gps/command'
import service from '@/utils/request'
function sendCmd({ imei, type, attributes }: { imei: string; type: string; attributes: any }, config = {}) {
  const data = {
    imei: imei,
    type,
    // id: this.cmdId,
    sync: true,
    cacheSec: 25,
    password: null,
    attributes
  }
  return sendCommandMini(data, config)
}
export function uploadRequest({
  imei,
  deviceId,
  dateTime,
  sequenceNo,
  fileTotal,
  platformAlarmId
}: {
  imei: string
  deviceId: string
  dateTime: string
  sequenceNo: number
  fileTotal: number
  platformAlarmId: string
}) {
  const attributes = {
    deviceId,
    dateTime,
    sequenceNo,
    fileTotal,
    platformAlarmId
  }
  return sendCmd({ imei, type: 'TYPE_SERVER_808_JSATL_UPLOAD_REQUEST', attributes })
}
